import $ from 'jquery';
window.$ = $;

function debounce(method, delay) {
	let timer = null;
	
	return function() {
		let self = this,
			args = arguments;

		timer && clearTimeout(timer);
		timer = setTimeout(function() {
			console.log(1)
			method.apply(self,args);
		}, delay);
	}
}

function portraitError(event){
	let img = require('./portrait.png')
	$(event.target).attr('src',img);
	
}

window.portraitError = portraitError;
window.debounce = debounce;